UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C+5Q48Za9RMxEZVAugp/nR6S95eiVzrzQLjBQHy15bk=' 
WHERE 
  key_id = '6846cc04e32f9e9043bfab17f53c57cdd0d460f132ffc280e2e9fee7c02bb85a' 
  AND (
    token = 'C+5Q48Za9RMxEZVAugp/nR6S95eiVzrzQLjBQHy15bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038