UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OinUI56mSvYN+JOSkvuZguLlqocpWiZqTXQ9xVLjzy8=' 
WHERE 
  key_id = '2521f0ce1f3a6ee938a545ad587739db004f4778285abe35f57e71d90212d392' 
  AND (
    token = 'OinUI56mSvYN+JOSkvuZguLlqocpWiZqTXQ9xVLjzy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041