UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LFlZmVNT8N0vK6aTDZfuEqPN1Qzk6joADNpFa5B4zmU=' 
WHERE 
  key_id = '18fdf98ce1e43a5d5530deaf00c87135eecdb1dd2d2faeae205074abfd77dcfa' 
  AND (
    token = 'LFlZmVNT8N0vK6aTDZfuEqPN1Qzk6joADNpFa5B4zmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00274