UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ELmuq2opuLavNJ44aXqHEpMb3ze87wjatNsnViYCGtM=' 
WHERE 
  key_id = 'bc1a6e17212614727a935a1cfacaa2409af0f07a91b1ccc94532acce147ba4b6' 
  AND (
    token = 'ELmuq2opuLavNJ44aXqHEpMb3ze87wjatNsnViYCGtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027