UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MMw5+N1+a6TBnPv46EVeFOjpXndMvBFd1azqwqC2Jvs=' 
WHERE 
  key_id = '49a2afbe48894fa4ffb93abe162f9ad2187e63edf4964eedac2ffe6bebfafdaa' 
  AND (
    token = 'MMw5+N1+a6TBnPv46EVeFOjpXndMvBFd1azqwqC2Jvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034