UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RF5urqKnTXyAbEHmAjwKZwq2la9R8rFQEpoORH1Y/78=' 
WHERE 
  key_id = 'aea831e8dde08ae7a8b30101bdc25ea947b379fa3fd14554d064a9efb2a210f9' 
  AND (
    token = 'RF5urqKnTXyAbEHmAjwKZwq2la9R8rFQEpoORH1Y/78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024