UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UcZc8ygxN2TJYHgksd1DDvuN29DPz/kCCHncFCES7kg=' 
WHERE 
  key_id = '640b8f34120565acda83a9f7ec7bc155f1e9b1bf60738f015cb4e3eb246d726e' 
  AND (
    token = 'UcZc8ygxN2TJYHgksd1DDvuN29DPz/kCCHncFCES7kg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030